

type IFn<T,U extends any[]> = (...args : U)=> Promise<T>


type successState<T> = {
  loading: false
  error?: undefined
  value: T
}

// type faliState = {
//   loading: false
//   error: 
//   value?: undefined
// }

type loadingState = {
  loading:boolean
  error?:undefined
  value?:undefined
}

const useAsync = <Result = any,Args extends any[] = any[]>(
  fn:IFn<Result,Args>,
  options:{
    deps:[],
    initialState:{loading:false}
  }
)=>{

    

  return [fn]
}

export default useAsync